package com.ruoyi.project.system.domain.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.project.system.domain.SysUser;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class DtUser {

    private Long userId;

    private String userName;

    private String nickName;

    private Long roleId;

    private BigDecimal balance;

    private String identityCode;

    private String command;

    private String loginIp;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date loginDate;

    public DtUser(SysUser sysUser) {
        this.userId = sysUser.getUserId();
        this.userName = sysUser.getUserName();
        this.nickName = sysUser.getNickName();
        this.roleId = sysUser.getRoleId();
        this.balance = sysUser.getBalance();
        this.identityCode = sysUser.getIdentityCode();
        this.command = sysUser.getCommand();
        this.loginIp = sysUser.getLoginIp();
        this.loginDate = sysUser.getLoginDate();
    }
}
